//引入axios
import request from '@/utils/request';
enum API {
    //获取SKU列表接口
    SKUURL="/admin/product/list/",
    //上架
    UPDATELIST ='/admin/product/onSale/',
    //下架
    DOWNLIST = '/admin/product/cancelSale/',
    //通过SKU的ID获取详情
    SKUINFO = "/admin/product/getSkuById/",
    //删除SKU接口
    DELETESKU = "/admin/product/deleteSku/"
}
//获取SKU列表
export const reqSkuList = (page:number,limit:number)=>request.get(API.SKUURL+`${page}/${limit}`);
//上架
export const reqUpdateList = (skuId:number) =>request.get(API.UPDATELIST+skuId);
//下架
export const reqDownList = (skuId:number) =>request.get(API.DOWNLIST+skuId);
//通过sku的ID获取详情
export const reqSkuInfo = (skuId:number) => request.get(API.SKUINFO+skuId);
//删除SKU的业务
export const reqDeleteSku = (skuId:number) =>request.delete(API.DELETESKU+skuId);